# -*- coding :utf-8 -*-

class MyDict(dict):

    def __missing__(self,key):
        return None


class MySQLInit:
    """
    MySQL
    """
    NAME = 'test'
    PORT = '3306'
    USER = 'root'
    PASSWORD = '123456'
    HOST ='localhost'
    @property
    def mysqlinit(self):
        
        _setting_list =  [getattr(self,__attr) for __attr in  filter(lambda _info : _info.upper() == _info , self.__dict__())]
        return all(_setting_list)

    def __dict__(self):
        return dir(self)

class PostgrestSQLInit(MySQLInit):
    """
    PG 
    """
    NAME = ''
    PORT = ''
    USER = ''
    PASSWORD = ''
    HOST = ''

DB_DICT = MyDict()
DB_DICT.update({
    'mysql':MySQLInit(),
    'PG':PostgrestSQLInit()
})